#pragma once

#include <Windows.h>
#include "Font.h"

class CStateManager;

// Base class for the different states
// of the game.
class CState
{
public:
	// Constructor
	CState(CStateManager* pManager, HDC hDC, HWND hWnd);
	// Destructor
	virtual ~CState();

	// The different 'events' functions. Child classes can 
	// implement the ones in which they are interested in.
	virtual void getKeyPressed() { }
	virtual bool Update(DWORD )  { return false; }
	virtual void Draw()  { }

	// Functions called when the state is entered or left
	// (transition from/to another state).
	virtual void EnterState()  { }
	virtual void LeaveState()   { }

protected:
	// Helper function to switch to a new active state.
	void ChangeState(CState* pNewState);

	HDC m_hDC;
	HWND m_hWnd;
	
	// The font used to draw text
	CFont* m_pFont;

	// The state manager.
	CStateManager* m_pStateManager;
};